"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var con = {
    name2: '水'
};
// 条件类型的分发
var con1 = { name2: '' };
var con2 = { name4: '' };
function getUser(a, b) {
    return { name: 'smd' };
}
var Person = /** @class */ (function () {
    function Person(name) {
        this.name = name;
    }
    Person.prototype.getName = function () {
        return this.name;
    };
    return Person;
}());
var a;
(function (a_1) {
    /**
      type PartialA = {
          a?: string | undefined;
          b?: number | undefined;
          c?: boolean | undefined;
      }
     */
    var a = {
        a: ''
    };
    var p = {
        id: 18,
        company: {
            id: 18
        }
    };
    var p1 = {
        name: 'smd',
        age: 18 // 不写age会有类型校验错误
    };
    var p2 = {
        name: 'smd',
        age: 18
    };
    var p3 = { name: 'smd', age: 18, gender: 2 };
    var ex = true; // type Ex = string | boolean
    // 6. Record  将一个类型的所有属性值都映射到另一个类型上并创造一个新的类型
    function mapObj(obj, map) {
        var rest = {};
        for (var key in obj) {
            rest[key] = map(obj[key]);
        }
        return rest;
    }
    var obj = { count1: 1, count2: 2, 3: 3 };
    var map = function (x) { return x * 2 + ''; };
    var newObj = mapObj(obj, map);
    console.log(newObj); // { '3': '6', count1: '2', count2: '4' }
})(a || (a = {}));
